﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Ur;
namespace Pixels
{
    static public class Utils
    {
        static public T[] randomSubset<T>(this T[] sourceArray, int count) {
            if (count >= sourceArray.Length) return sourceArray;
            
            sourceArray.Shuffle();            
            var l = new List<T>();
            for (int i = 0; i < count; i++) l.Add(sourceArray[i]);
            return l.ToArray();
        }
    }
}
